<%@ page import="java.util.ArrayList" %><%--
  Created by IntelliJ IDEA.
  User: Administrator
  Date: 2021/10/20
  Time: 9:53
  To change this template use File | Settings | File Templates.
--%>

<%@page isELIgnored="false" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>Title</title>
</head>
<body>
<%--EL表达式的作用域--%>
    <%
        ArrayList<String> al = new ArrayList<>();

        al.add("cat");
        al.add("dog");
        al.add("pig");

        pageContext.setAttribute("list",al);
        application.setAttribute("list",al);
        session.setAttribute("list",al);
        request.setAttribute("list",al);
    %>

<%--    根据下标获取数组值   数组【索引】--%>
    ${list}<br>
    ${list[0]}<br>
    ${list[1]}<br>
    ${list[2]}<br>
</body>
</html>
